<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap jj">
  <ul class="nav nav-tabs">
  
     <li class="active"><a href="{:U('user/add')}">添加代理商</a></li>
  </ul>
  <div class="common-form">
    <form method="post" class="form-horizontal J_ajaxForm" action="{:U('Agent/add_post')}">
      <div class="table_list">
        <table cellpadding="2" cellspacing="2" class="table_form" width="100%">
          <tbody>
            <tr>
              <td width="180">用户名:</td>
              <td><input type="text" class="input" name="user_login" value=""></td>
            </tr>
            <tr>
              <td>密码:</td>
              <td><input type="password" class="input" name="user_pass" value="" ></td>
            </tr>
            <tr>
              <td>邮箱:</td>
              <td><input type="text" class="input" name="user_email" value=""></td>
            </tr>
            <tr>
              <td>代理商名称:</td>
              <td><input type="text" class="input" name="agent_name" value=""></td>
            </tr>
            
            <tr>
              <td>所在地区</td>
              <td>	<select class="input span2" id="s_province" name="s_province">
                     	<option>请选择省份</option>								
                     </select>
						&nbsp;&nbsp;
	    				<select class="input span2" id="s_city" name="s_city" >
	    					<option>请选择城市</option>
							
	    				</select>
						&nbsp;&nbsp;
	    				<select class="input span2" id="s_county" name="s_county">
	    						<option>请选择县区</option>
							
	    				</select>
			  </td>
            
            
            </tr>
            
            
            
            <tr>
              <td>联系电话:</td>
              <td><input type="text" class="input" name="agent_tel" value=""></td>
            </tr>
            <tr>
              <td>联系人:</td>
              <td><input type="text" class="input" name="agent_ren" value=""></td>
            </tr>
            <tr>
              <td>域名前缀:</td>
              <td><input type="text" class="input" name="agent_dome" value=""></td>
            </tr>
            
            
           
            
          </tbody>
        </table>
      </div>
      <div class="form-actions">
            <button type="submit" class="btn btn-primary btn_submit J_ajax_submit_btn">添加</button>
            <a class="btn" href="__URL__">返回</a>
      </div>
    </form>
  </div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
<script type="text/javascript">
	jQuery(function(){
		
		var s_province=$("#s_province");
		var s_city=$("#s_city");
		var s_county=$("#s_county");
		
		ajax({"obj":s_province,"fup":"0"});
		s_province.change(function(){
				ajax({"obj":s_city,"fup":$(this).val()});
		});
		s_city.change(function(){
			ajax({"obj":s_county,"fup":$(this).val()});
		
		});
		
				
		function ajax(query){
			var posturl = "{:u('admin/agent/area')}";
			$.ajax({
				url: posturl,
				data: "fup="+query.fup,
				type: "post",
				dataType: "json",
				success: function(result){
					if (result.status == 1) {
						
							query.obj.html(query.obj.find("option").eq(0));
							query.obj.append(result.info);
					}
					else {
						$.showErr(result.info);
					}
				},
				error: function(){
					$.showErr("发生错误");
				}
			});
		}
	
	});

</script>
	


</body>
</html>